package com.serviceprovider.business.module.report.valueobjects;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.sp.transaction.model.TransactionStatus;

/**
 * Created by IntelliJ IDEA.
 * User: akilesa
 * Date: 10-May-2010
 * Time: 1:05:24 PM
 * To change this template use File | Settings | File Templates.
 */
public class TransStatusVO {
    private boolean isActive  = false;
    private boolean isChecked = false;
    private Integer id;
    private String  meaning;
    private String  name;

    public TransStatusVO() {}

    public TransStatusVO(TransactionStatus status) {
        this.id       = status.getId();
        this.name     = status.getName();
        this.meaning  = status.getMeaning();
        this.isActive = status.isActive();
    }

    public TransStatusVO(Integer id, String name, String meaning, boolean active) {
        this.id      = id;
        this.name    = name;
        this.meaning = meaning;
        isActive     = active;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMeaning() {
        return meaning;
    }

    public void setMeaning(String meaning) {
        this.meaning = meaning;
    }

    public boolean isActive() {
        return isActive;
    }

    public void setActive(boolean active) {
        isActive = active;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    @Override
    public boolean equals(Object obj) {
        if ((obj == null) ||!(obj instanceof TransStatusVO)) {
            return false;
        }

        TransStatusVO b  = (TransStatusVO) obj;
        boolean       eq = ((id == null) && (b.id == null)) || ((id != null) && id.equals(b.id));

        if (!eq) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return (id != null)
               ? id.hashCode()
               : 0;
    }
}



